/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package translationTable;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Karim Naaji <karim.naaji@gmail.com>
 */
public class Method {
    private ArrayList<String> attributes;
    private ArrayList<String> ancestors;
    private String name;
    private String visibility;
    private String returnType;
    private String packageName;
    private String className;
    
    public Method(String className_, String name_) {
        name = name_;
        className = className_;
    }
    
    public Method(String className, String functionName, 
            String visibility, String returnType, ArrayList<String> attributes){
        this.className = className;
        this.name = functionName;
        this.visibility = visibility;
        this.returnType = returnType;
        this.attributes = attributes;
    }
    
    public Method(){}
    
    public String getVisibility() {
        return visibility;
    }
    
    public String getName() {
        return name;
    }
    
    public String getReturnType() {
        return returnType;
    }
    
    public String getClassName() {
        return className;
    }
    
    public List<String> getAttributes() {
        return attributes;
    }
    
    
    public List<String> getAncestors() {
        return ancestors;
    }
    
    public String getPackage() {
        return packageName;
    }
    
    
    public void setVisibility(String visibility_) {
        visibility = visibility_;
    }
    
    public void setClassName(String name_) {
        className = name_;
    }
    
    public void setName(String name_) {
        name = name_;
    }
    
    public void setReturnType(String returnType_) {
        returnType = returnType_;
    }
    
    public void setAttributes(ArrayList<String> attributes_) {
        attributes = (ArrayList<String>) attributes_.clone();
    } 
    
    public void setAncestors(ArrayList<String> ancestors_) {
        ancestors = ancestors_;
    }
    
    public void setPackage(String packageName_) {
        packageName = packageName_;
    }
    
    @Override
    public String toString() {
        return visibility + " " + className + "." + name + "( "+ attributes + ") : " + returnType;
    }
}
